package server.content.skills.mining;

import java.util.LinkedList;
import java.util.List;

import server.game.players.Client;

public class MineHandler {

	private final static List<Rock> rocks = new LinkedList<Rock>();

	public static void addRock(final Client c, final int rockId, final int x,
			final int y) {
		rocks.add(new Rock(c, rockId, x, y));
	}

	public static boolean rockExists(final int x, final int y) {
		for (final Rock rock : rocks) {
			if (rock == null)
				continue;
			if (rock.getX() == x && rock.getY() == y) {
				return true;
			}
		}
		return false;
	}

	public static Rock getRock(final int x, final int y) {
		for (final Rock rock : rocks) {
			if (rock == null)
				continue;
			if (rock.getX() == x && rock.getY() == y) {
				return rock;
			}
		}
		return null;
	}

}
